package framework.base;

import java.util.List;

import framework.Page;

public abstract class BaseService<E> implements IBaseService<E> {

	public abstract IBaseDao getBaseDao();

	@Override
	public E selectOne(IBaseQuery ob) {
		return (E) getBaseDao().selectOne(ob);
	}

	@Override
	public List<E> selectList(IBaseQuery ob, Page page) {
		return (List<E>) getBaseDao().selectList(ob, page);
	}

	@Override
	public List<E> selectList(IBaseQuery ob) {
		return (List<E>) getBaseDao().selectList(ob, null);
	}

	@Override
	public Object insert(E entity) {
		return getBaseDao().insert(entity);
	}

	@Override
	public Object delete(E entity) {
		return getBaseDao().delete(entity);
	}

	/** 批量修改数据 */
	@Override
	public void delete(List<E> list) {
		getBaseDao().delete(list);
	}

	@Override
	public Object update(E entity) {
		return getBaseDao().update(entity);
	}

	@Override
	public void update(List<E> list) {
		getBaseDao().update(list);
	}

	public Integer selectCount(E entity) {
		return getBaseDao().selectCount(entity);
	}

}
